﻿Public Class otherMath

    Public Shared Function DegToRad(ByVal val As Double) As Double
        Return val * math.Acos(-1.0) / 180.0
    End Function

    Public Shared Function RadToDeg(ByVal val As Double) As Double
        Return val * 180.0 / math.Acos(-1.0)
    End Function

    Public Shared Function distance(ByVal p1 As vector, ByVal p2 As vector) As Double

        Return Math.Sqrt(Math.Pow(p2.x - p1.x, 2) + Math.Pow(p2.y - p1.y, 2))

    End Function

    Public Shared Function degNormalize(ByVal value As Double) As Double

        value = value Mod 360
        If value > 180 Then
            Return value - 360
        Else
            Return value
        End If

    End Function

End Class
